<template>
    <!-- 广告图 -->
    <div class="rotation-advertisement">
        <el-carousel
            indicator-position="outside"
            height="480px"
            v-loading="loading"
        >
            <el-carousel-item v-for="item in banner" :key="item.id">
                <img :src="item.picture" :alt="item.name" />
            </el-carousel-item>
        </el-carousel>
    </div>
</template>

<script setup>
import { onMounted, ref } from 'vue'
import { findAllBanner } from '@/apis/home'
let banner = ref([])
let loading = ref(true)
onMounted(async () => {
    let ban = await findAllBanner()
    banner.value = banner.value.concat(ban)
    loading.value = false
})
</script>

<style lang="scss" scoped>
.rotation-advertisement {
    width: 900px;
    position: absolute;
    top: 15px;
    left: 210px;
    border-radius: 20px;
    overflow: hidden;
    --el-color-primary: #da9233;
    img {
        border-radius: 20px;
        width: 100%;
        height: 100%;
    }
}
</style>
